EJB / JSF java.lang.ClassNotFoundException: com.ericsantanna.jobFC.dao.DAOFactoryRemote from [Module "com.sun.jsf-impl:main" from local module loader

Posted by Eric Sant'Anna on Stack Overflow See other posts from Stack Overflow or by Eric Sant'Anna
Published on 2012-11-22T22:57:55Z Indexed on 2012/11/22 22:59 UTC
Read the original article Hit count: 209

Filed under:
|
|
|
|

I'm in my first time using EJB and JSF, and I can't resolve this:

     20:23:12,457 Grave [javax.enterprise.resource.webcontainer.jsf.application] (http-localhost-127.0.0.1-8081-2) com.ericsantanna.jobFC.dao.DAOFactoryRemote from [Module "com.sun.jsf-impl:main" from local module loader @439db2b2 (roots: C:\jboss-as-7.1.1.Final\modules)]: java.lang.ClassNotFoundException: com.ericsantanna.jobFC.dao.DAOFactoryRemote from [Module "com.sun.jsf-impl:main" from local module loader @439db2b2 (roots: C:\jboss-as-7.1.1.Final\modules)]

I'm getting this when I do an action like a selectOneMenu or a commandButton click.

DAOFactory.class

@Singleton
@Remote(DAOFactoryRemote.class)
public class DAOFactory implements DAOFactoryRemote {

private static final long serialVersionUID = 6030538139815885895L;

@PersistenceContext
private EntityManager entityManager;

@EJB
private JobDAORemote jobDAORemote;

/**
 * Default constructor. 
 */
public DAOFactory() {
    // TODO Auto-generated constructor stub
}

@Override
public JobDAORemote getJobDAO() {
    JobDAO jobDAO = (JobDAO) jobDAORemote;
    jobDAO.setEntityManager(entityManager);

    return jobDAO;
}

JobDAO.class

@Stateless
@Remote(JobDAORemote.class)
public class JobDAO implements JobDAORemote {

private static final long serialVersionUID = -5483992924812255349L;

private EntityManager entityManager;

/**
 * Default constructor. 
 */
public JobDAO() {
    // TODO Auto-generated constructor stub
}

@Override
public void insert(Job t) {
    entityManager.persist(t);
}

@Override
public Job findById(Class<Job> classe, Long id) {
    return entityManager.getReference(classe, id);
}

@Override
public Job findByName(Class<Job> clazz, String name) {
    return entityManager
            .createQuery("SELECT job FROM " + clazz.getName() + " job WHERE job.nome = :nome"
                , Job.class)
            .setParameter("name", name)
            .getSingleResult();
}
...

TriggerFormBean.class

@ManagedBean
@ViewScoped
@Stateless
public class TriggerFormBean implements Serializable    {

private static final long serialVersionUID = -3293560384606586480L;

@EJB
private DAOFactoryRemote daoFactory;

@EJB
private TriggerManagerRemote triggerManagerRemote;
...

triggerForm.xhtml (a portion with problem)

                            </p:layoutUnit>
                            <p:layoutUnit id="eastConditionPanel" position="center" size="50%">
                                <p:panel header="Conditions to Release"  style="width:97%;height:97%;">
                                    <h:panelGrid columns="2" cellpadding="3">
                                        <h:outputLabel value="Condition Name:" for="conditionName" />
                                        <p:inputText id="conditionName" value="#{triggerFormBean.newCondition.name}" />
                                    </h:panelGrid>

                                    <p:commandButton value="Add Condition" update="conditionsToReleaseList" id="addConditionToRelease"  
                                        actionListener="#{triggerFormBean.addNewCondition}" />

                                    <p:orderList 
                                            id="conditionsToReleaseList" 
                                            value="#{triggerFormBean.trigger.conditionsToRelease}" 
                                            var="condition" 
                                            controlsLocation="none"  
                                            itemLabel="#{condition.name}" 
                                            itemValue="#{condition}" 
                                            iconOnly="true"
                                            style="width:97%;heigth:97%;"/>
                                  </p:panel>
                        </p:layoutUnit>

In TriggerFormBean.class if comments daoFactory we get the same exception with triggerManagerRemote, both annotated with @EJB.

I'm don't understand the relationship between my DAOFactory and the "Module com.sun.jsf-impl:main"...

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about jsf-2